package org.whh.beans.factory.support;

import org.whh.beans.factory.config.SingletonBeanRegistry;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class DefaultSingletonBeanRegistry implements SingletonBeanRegistry {
    private final Map<String,Object> beanMap = new ConcurrentHashMap<>();
    @Override
    public Object getSingleton(String name) {
        return beanMap.get(name);
    }

    protected void addSingleton(String name,Object o){
        beanMap.put(name,o);
    }
}
